﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="SSFGLAdd.aspx.cs" Inherits="SSFGL_SSFGLAdd" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v12.1, Version=12.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
  Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dxe" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
  <title>实收费</title>
  <link href="../images/skin.css" rel="stylesheet" type="text/css" />
</head>
<body>
  <form id="form1" runat="server" defaultbutton="btnDX">
  <table width="700" border="1" cellspacing="0" cellpadding="0" class="table1" style="font-size: 14px;">
    <tr height="20">
      <td width="25%" align="right" bgcolor="#E7E7E7">
        <asp:HiddenField ID="hlJFSJ" runat="server" />
        客户编码
      </td>
      <td width="75%" bgcolor="#FFFFFF">
        <asp:Label ID="lbKHBM" runat="server" Text=""></asp:Label>
      </td>
    </tr>
    <tr height="20">
      <td width="25%" align="right" bgcolor="#E7E7E7">
        客户名称
      </td>
      <td width="75%" bgcolor="#FFFFFF">
        <asp:Label ID="lbKHMC" runat="server" Text=""></asp:Label>
      </td>
    </tr>
    <tr height="20">
      <td align="right" bgcolor="#E7E7E7">
        上期结余
      </td>
      <td bgcolor="#FFFFFF">
        <asp:Label ID="lbSQJCK" runat="server" Text=""></asp:Label>
      </td>
    </tr>
    <tr height="20">
      <td align="right" bgcolor="#E7E7E7">
        本期气费
      </td>
      <td bgcolor="#FFFFFF">
        <asp:Label ID="lbBQQF" runat="server" Text=""></asp:Label>
      </td>
    </tr>
    <tr height="20">
      <td align="right" bgcolor="#E7E7E7">
        本期应收款
      </td>
      <td bgcolor="#FFFFFF">
        <asp:Label ID="lbBQYSK" runat="server" Text=""></asp:Label>
      </td>
    </tr>
    <%--<tr>
      <td colspan="2">
        <table width="100%" border="1" cellspacing="0" cellpadding="0" class="table1">
          <tr bgcolor="#E7E7E7" height="20">
            <td colspan="5" align="center">
              本期气费明细
            </td>
          </tr>
          <tr bgcolor="#E7E7E7" height="20">
            <td align="center">
              用气性质
            </td>
            <td align="center">
              用气量
            </td>
            <td align="center">
              单价
            </td>
            <td align="center">
              基金
            </td>
            <td align="center">
              金额
            </td>
          </tr>
          <%
            System.Data.DataSet ds = JFSJ.GetQLMX(CommonUse.GetID("khid"));
            if (ds != null)
            {
              for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
              { %>
          <tr height="20" bgcolor="#FFFFFF">
            <td align="center">
              <%=ds.Tables[0].Rows[i]["yqxz"].ToString() + "&nbsp"%>
            </td>
            <td align="center">
              <%=ds.Tables[0].Rows[i]["ysql"].ToString() + "&nbsp"%>
            </td>
            <td align="center">
              <%=ds.Tables[0].Rows[i]["jg"].ToString() + "&nbsp"%>
            </td>
            <td align="center">
              <%=ds.Tables[0].Rows[i]["jj"].ToString() + "&nbsp"%>
            </td>
            <td align="center">
              <%=ds.Tables[0].Rows[i]["je"].ToString() + "&nbsp"%>
            </td>
          </tr>
          <%}
            }%>
        </table>
      </td>
    </tr>--%>
    <tr height="20">
      <td align="right" bgcolor="#E7E7E7">
        付款方式
      </td>
      <td bgcolor="#FFFFFF">
        <asp:DropDownList ID="ddlFKFS" runat="server">
        </asp:DropDownList>
        <asp:HiddenField ID="hlFKFS" runat="server" />
      </td>
    </tr>
    <tr height="20">
      <td align="right" bgcolor="#E7E7E7">
        本次实收款
      </td>
      <td bgcolor="#FFFFFF">
        <asp:TextBox ID="txtName" runat="server"></asp:TextBox>
        <asp:HiddenField ID="hlName" runat="server" />
        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="*"
          ControlToValidate="txtName"></asp:RequiredFieldValidator>
        <asp:RangeValidator ID="RangeValidator1" runat="server" ErrorMessage="请输入正数" ControlToValidate="txtName"
          MaximumValue="100000000" MinimumValue="0" Type="Double"></asp:RangeValidator>
        <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ErrorMessage="小数位保留两位"
          ControlToValidate="txtName" ValidationExpression="\d{1,}\.?\d{0,2}"></asp:RegularExpressionValidator>
        <asp:Button ID="btnDX" runat="server" Text="查看大写金额(点击键盘回车也可)" OnClick="btnDX_Click" />
        <asp:Label ID="lbDX" runat="server" Text="" Font-Size="14px"></asp:Label>
      </td>
    </tr>
    <tr height="20">
      <td align="right" bgcolor="#E7E7E7">
        本期结余
      </td>
      <td bgcolor="#FFFFFF">
        <asp:Label ID="lbBQJQK" runat="server" Text="&nbsp;"></asp:Label>
      </td>
    </tr>
  </table>
  <table width="615">
    <tr>
      <td align="center">
        <table>
          <tr>
            <td>
              <%--  <input id="Button1" type="button" value="button" onclick="b()" />--%>
              <dxe:ASPxButton ID="btnConfirm" runat="server" Text="保存" AutoPostBack="False" OnClick="btnConfirm_Click"
                Font-Size="14px">
                <ClientSideEvents Click="function(s,e) {
                if(!c()){alert('实收款不能为空');return;}
                var bqjy=a();
                e.processOnServer = confirm('本期结余为'+bqjy+',保存后无法更改，确认保存?'); 
                if(e.processOnServer){b();} }" />
              </dxe:ASPxButton>
            </td>
            <td>
              <dxe:ASPxHyperLink ID="ASPxHyperLink1" runat="server" Font-Size="14px" Text="返回"
                NavigateUrl="SSFGLList.aspx" Width="40px">
                <Border BorderWidth="1px" />
              </dxe:ASPxHyperLink>
            </td>
            <td>
              <asp:HyperLink ID="hlExport" runat="server" Target="_blank" BorderWidth="1px" Width="40px">打印</asp:HyperLink>
              <%-- <dxe:ASPxHyperLink ID="hlExport" runat="server" Text="打印" Font-Size="14px" Target="_blank"
                Width="40px" NavigateUrl="SSFGLExport.aspx">
                <Border BorderWidth="1px" />
              </dxe:ASPxHyperLink>--%>
            </td>
            <td>
              <asp:Label ID="lbMessage" runat="server" Text="" ForeColor="Red"></asp:Label>
            </td>
          </tr>
        </table>
      </td>
    </tr>
  </table>
  </form>
</body>
<script language="javascript">
  function a() {
    var a = document.getElementById("lbBQYSK").innerText;
    var b = document.getElementById("txtName").value;
    //    a = parseInt(a * 100);
    //    b = parseInt(b * 100);
    //    var c = Number(0);
    //    c = (parseInt(b - a) / 100).toString();
    //    c = c.substring(0, c.length - 2);
    //            var c = Math.ceil((b - a) * 100) / 100;
    var c = Math.round((b - a) * 100) / 100;
    //    c=0.01-0.02;
    return c;
  }
  function b() {
    document.getElementById("btnConfirm").style.display = "none";
  }
  function c() {
    var b = document.getElementById("txtName").value;
    if (b.length == 0)
      return false;
    else return true;
  }
</script>
</html>
